{extend name='template/base'}{/extend}
{block name='title'}{/block}
{block name='style'}{/block}
{block name='script'}{/block}

{block name='content'}
<header class="header">
    <div>
        <a class="goback"><i class="iconfont icon-zuoyoujiantou-copy-copy-copy"></i></a>
        订单管理
    </div>
</header>
<div class="pages" >
    <div id="tab-head" class="tab-head">
        <ul>
            <li v-bind:class="[1==t_index? 'active' : '']" @tap="tab_1(1)" ><a>待配送</a></li>
            <li v-bind:class="[2==t_index? 'active' : '']" @tap="tab_2(2)"><a>配送中</a></li>
            <li v-bind:class="[3==t_index? 'active' : '']" @tap="tab_3(3)"><a>已收货</a></li>
        </ul>
    </div>
    <div class="tab-body" >
        <div id="refreshContainer" class="mui-scroll-wrapper">
            <div class="mui-scroll" id="mui-scroll">
                <div id="order_div" class="list-form other has-b">
                    <template v-for="item in items">
                        <ul  v-for="vo in item">
                            <li @tap.stop="detail(vo.id)">
                                <div>
                                    订单号： {{vo.order_sn}}
                                    <span  class="pull-right" style="color: #C2C2C2">{{vo.order_time}}</span>
                                </div>
                                <div class="color-primary">
                                    {{vo.flag_status.text}}
                                </div>
                            </li>
                            <li @tap.stop="detail(vo.id)" class="goods-list small">
                                <ul>
                                    <li v-for="ivo in vo.order_items">
                                        <div class="img"><img :src="ivo.logo" height="441"
                                                              width="500"/></div>
                                        <div class="text">
                                            <div class="title">{{ivo.store_name}}</div>
                                            <p class="color-primary">￥{{ivo.pay_amount}}</p>
                                        </div>
                                    </li>
                                    <!--<li>-->
                                    <!--<div class="img"><img src="../../../../public/wechat/static/image/timo.jpg" height="441"-->
                                    <!--width="500"/></div>-->
                                    <!--<div class="text">-->
                                    <!--<div class="title">商家名称</div>-->
                                    <!--<p class="color-primary">￥18.8</p>-->
                                    <!--</div>-->
                                    <!--</li>-->
                                </ul>
                            </li>
                            <li style="min-height: 43px;">
                                <div class="absmiddle-left">
                                    <div>合计：<span class="color-primary">￥{{vo.pay_amount}}</span></div>
                                </div>
                                <div class="text-right">
                                    <a v-if="(vo.flag_status.value==0||vo.flag_status.value==5)" class="btn color-primary" @tap.stop="delivery(vo.id)">立即配送</a>
                                    <a v-else style="background-color: grey;">{{vo.flag_status_text}}</a>
                                </div>
                            </li>
                        </ul>
                    </template>
                </div>
            </div>
            <div class="tip-icon" id="tip-icon" style="display: none;"> <i class="iconfont icon-dingdan"></i> <p>暂无订单</p> </div>
        </div>
    </div>
</div>
{/block}
{block name='script_extra'}
<script>
    var list_url = "{:url('index/Order/index')}";
    var detail_url = "{:url('index/Order/detail')}";
    var delivery_url = "{:url('index/Order/delivery')}";
    require(['index/index']);
</script>
{/block}